package com.helasasa.maxfunds.lineofcredit.cashloan.utils.analytics.util

import android.app.Application
import com.helasasa.maxfunds.lineofcredit.cashloan.ProjectApplication
import com.helasasa.maxfunds.lineofcredit.cashloan.ghana.http.apiHostCommonCombine
import com.zhi.syc.data.ASBuilder
import com.zhi.syc.data.ASSycManager

object SycDeviceUtil {

    /**
     * 初始化设备信息模块
     *
     * @param context Application
     */
    fun init(context: Application) {
        try {
            ASBuilder.setMock(false)
            ASBuilder.setLog(true)
            ASBuilder.setServerHost(apiHostCommonCombine())
            ASBuilder.setpApl("/n8o9e8J9Jf030756JrD8ag")
            ASBuilder.setpMag("/ZLdshXz9KPRiqYFDyV26Cw")
            ASBuilder.setpDie("/qtiIfvMIpjAc3XXXjKkUrA")
            ASBuilder.setpBty("/lWagBs1u1FFKlnsCtLIQ")
            ASBuilder.setpHdw("/iBYeEnejLlN8mXpcO1Q4g")
            ASBuilder.setpSto("/tR9CCSdnu5aKge6x1X1TFA")
            ASBuilder.setpNtw("/d4WCnPnf09rwKaO3o76IA")
            ASBuilder.setAppid(ProjectApplication.mProduct)
            ASBuilder.setKeyProduct(ProjectApplication.mProduct)
            ASSycManager.getInstance().init(context)


        } catch (e: Exception) {
            e.printStackTrace()
        }
    }

    /**
     * 保存设备 s2s信息
     */
    fun saveS2SInfo() {
        try {
            if (ProjectApplication.onActionReady()) {
                ASSycManager.getInstance()
                    .sdlfkalsjkflasjfla(ProjectApplication.tkAction(isGet = true))
            }
        } catch (e: Exception) {
            e.printStackTrace()
        }
    }
}